<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>
<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath%>">
<meta charset="UTF-8">

<link href="../../jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery/jquery-1.11.1-min.js"></script>
<script type="text/javascript" src="../../jquery/bootstrap_3.3.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../jquery/bs_pagination/jquery.bs_pagination.min.css">
<script type="text/javascript" src="../../jquery/bs_pagination/jquery.bs_pagination.min.js"></script>
<script type="text/javascript" src="../../jquery/bs_pagination/en.js"></script>
<link href="../../jquery/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="../../jquery/bootstrap-datetimepicker-master/locale/bootstrap-datetimepicker.zh-CN.js"></script>

<script type="text/javascript">

	$(function(){
		//定制字段
		$("#definedColumns > li").click(function(e) {
			//防止下拉菜单消失
	        e.stopPropagation();
	    });

        //时间组件
        $(".time").datetimepicker({
            minView: "month",
            language:  'zh-CN',
            format: 'yyyy-mm-dd',
            autoclose: true,
            todayBtn: true,
            pickerPosition: "bottom-left"
        });


        //对创建人下拉框赋值
		function getSysUserList(){
            $.ajax({

                url : "sysUser/getSysUserList",
                type : "get",
                dataType : "json",
                success : function (data) {

					var html = "<option></option>";

                    //遍历出来的每一个n，就是每一个user对象
                    $.each(data,function (i,n) {
                        html += "<option value='"+n.userId+"'>"+n.userName+"</option>";
                    });

                    $("#create-chcCreateBy").html(html);
                    $("#edit-chcCreateBy").html(html);
                    $("#create-chcDueTo").html(html);
                    $("#designate-chcDueTo").html(html);
                    $("#edit-chcDueTo").html(html);

                }

            });
		}
		getSysUserList();

        //为全选的复选框绑定事件，触发全选操作
        $("#qx").click(function () {

            $("input[name=xz]").prop("checked",this.checked);

        });

		//为保存按钮绑定事件，执行添加操作
		$("#createBtn").click(function () {
			$.ajax({
				url : "marketing/save",
				data : {
					"chcSource": $.trim($("#create-chcSource").val()),
					"chcCustName": $.trim($("#create-chcCustName").val()),
					"chcTitle": $.trim( $("#create-chcTitle").val()),
					"chcRate": $.trim($("#create-chcRate").val()),
					"chcLinkman": $.trim($("#create-chcLinkman").val()),
					"chcTel":$.trim($("#create-chcTel").val()),
					"chcDesc":$.trim($("#create-chcDesc").val()),
					"chcCreateId": $.trim($("#create-chcCreateBy").val()),
					"chcCreateBy": $.trim($("#create-chcCreateBy").find("option:selected").text()),
					"chcDueId": $.trim($("#create-chcDueId").val()),
					"chcDueTo": $.trim($("#create-chcDueTo").val()),
					"chcStatus": $.trim($("#create-chcStatus").val())
				},
				type : "post",
				dataType : "json",
				success : function (data) {
					if(data.success){
						//保存客户成功之后，会进行一次页面刷新，刷新出保存的用户，根据创建时间来进行排序
						pageList(1,$("#marketingPage").bs_pagination('getOption', 'rowsPerPage'));
						$("#marketingCreateForm")[0].reset();
						//关闭添加操作的模态窗口
						$("#createSalChanceModal").modal("hide");
					}else{
						alert("添加市场活动失败");
					}
				}
			})

		});

		//为修改按钮绑定事件，打开修改操作的模态窗口
        $("#editBtn").click(function () {
            var $xz = $("input[name=xz]:checked");
            if($xz.length==0){
                alert("请选择需要修改的记录");
            }else if($xz.length>1){
                alert("只能选择一条记录进行修改");
                //肯定只选了一条
            }else{
                var chcId = $xz.val();
                $.ajax({
                    url : "marketing/getSalChanceByChcId/"+chcId,
                    type : "get",
                    dataType : "json",
                    success : function (data) {

                        //处理单条customer,并赋值给各标签

						if (data.success){
                            $("#edit-chcId           ")          .            val(data.salChance.chcId);
                            $("#edit-chcSource       ")      .         val(data.salChance.chcSource);
                            $("#edit-chcCustName     ")    .    val(data.salChance.chcCustName);
                            $("#edit-chcTitle        ")       .       val(data.salChance.chcTitle);
                            $("#edit-chcRate         ")        .  val(data.salChance.chcRate);
                            $("#edit-chcLinkman      ")     .        val(data.salChance.chcLinkman);
                            $("#edit-chcTel          ")         .   val(data.salChance.chcTel);
                            $("#edit-chcDesc         ")        .       val(data.salChance.chcDesc);
                            $("#edit-chcCreateId     ")    .         val(data.salChance.chcCreateId);
                            $("#edit-commonCreateBy").          val(data.salChance.chcCreateBy);
                            $("#edit-commonCreateDate").val(data.salChance.chcCreateDate);
                            $("#edit-chcCreateDate   ")  .          val(new Date(data.salChance.chcCreateDate).format("yyyy-MM-dd hh:mm:ss"));
                            $("#edit-chcDueId        ")       .          val(data.salChance.chcDueId);
                            $("#edit-chcDueTo        ")       .      val(data.salChance.chcDueTo);
							$("#edit-commonDueDate").val(data.salChance.chcDueDate);
                            $("#edit-chcStatus       ")      .    val(data.salChance.chcStatus);
                            //所有的值都填写好之后，打开修改操作的模态窗口
                            $("#editSalChanceModal").modal("show");
						}else {
                            $("#marketingEditForm")[0].reset();
                            $("#editSalChanceModal").modal("hide");
						}

                    }
                })
            }
        });

        //为更新按钮绑定事件，执行市场活动的修改操作
        $("#updateBtn").click(function () {

            $.ajax({
                url : "marketing/update",
                data : {
                    "chcId": $.trim($("#edit-chcId").val()),
                    "chcSource": $.trim($("#edit-chcSource").val()),
                    "chcCustName": $.trim($("#edit-chcCustName").val()),
                    "chcTitle": $.trim( $("#edit-chcTitle").val()),
                    "chcRate": $.trim($("#edit-chcRate").val()),
					"chcLinkman": $.trim($("#edit-chcLinkman").val()),
                    "chcTel":$.trim($("#edit-chcTel").val()),
                    "chcDesc":$.trim($("#edit-chcDesc").val()),
                    "chcCreateId": $.trim($("#edit-chcCreateId").val()),
                    "chcCreateBy": $.trim($("#edit-commonCreateBy").val()),
					"commonCreateBy" : $.trim($("#edit-chcCreateBy").val()),
                    "chcDueId": $.trim($("#edit-chcDueId").val()),
                    "chcDueTo": $.trim($("#edit-chcDueTo").val()),
                    "chcStatus": $.trim($("#edit-chcStatus").val())
                },
                type : "post",
                dataType : "json",
                success : function (data) {
                    if(data.success){

                        pageList($("#marketingPage").bs_pagination('getOption', 'currentPage')
                            ,$("#marketingPage").bs_pagination('getOption', 'rowsPerPage'));
                        $("#marketingEditForm")[0].reset();
                        //关闭修改操作的模态窗口
                        $("#editSalChanceModal").modal("hide");
                    }else{
                        alert("修改市场活动失败");
                    }
                }
            })
        });


        $("#designateOpenBtn").click(function () {
			var $xz = $("input[name=xz]:checked");
			if($xz.length==0){
				alert("请选择需要修改的记录");
			}else if($xz.length>1){
				alert("只能选择一条记录进行修改");
				//肯定只选了一条
			}else{
				var chcId = $xz.val();
				$.ajax({
					url : "marketing/getSalChanceByChcId/"+chcId,
					type : "get",
					dataType : "json",
					success : function (data) {

						//处理单条customer,并赋值给各标签
						if (data.success){
							$("#designate-chcCustName").val(data.salChance.chcCustName);
							$("#designate-commonCreateBy").val(data.salChance.chcCreateBy);
							$("#designate-chcId").val(data.salChance.chcId);
							//所有的值都填写好之后，打开修改操作的模态窗口
							$("#designateManagerModal").modal("show");
						}else {
							$("#designateManagerForm")[0].reset();
							$("#designateManagerModal").modal("hide");
						}

					}
				})
			}
		});

        //指派执行经理或者主管
		$("#designateBtn").click(function () {
			$.ajax({

				url : "marketing/update",
				data : {
					"chcCustName" : $.trim($("#designate-chcCustName").val()),
					"chcCreateBy" : $.trim($("#designate-commonCreateBy").val()),
					"chcDueTo" : $.trim($("#designate-chcDueTo").val()),
					"chcId" : $.trim($("#designate-chcId").val())
				},
				type : "post",
				dataType : "json",
				success : function (data) {
					if(data.success){
						pageList($("#marketingPage").bs_pagination('getOption', 'currentPage')
								,$("#marketingPage").bs_pagination('getOption', 'rowsPerPage'));
						$("#designateManagerForm")[0].reset();
						//关闭修改操作的模态窗口
						$("#designateManagerModal").modal("hide");
					}else{
						alert("修改市场活动失败");
					}
				}
			})
		});


         //为删除按钮绑定事件，执行市场活动删除操作
        $("#deleteBtn").click(function () {
            //找到复选框中所有挑√的复选框的jquery对象
            var $xz = $("input[name=xz]:checked");
            if($xz.length==0){
                alert("请选择需要删除的记录");
                //肯定选了，而且有可能是1条，有可能是多条
            }else{
                if(confirm("确定删除所选中的记录吗？")){
                    //拼接参数
                    var param = "";
                    //将$xz中的每一个dom对象遍历出来，取其value值，就相当于取得了需要删除的记录的id
                    for(var i=0;i<$xz.length;i++){
                        param += "chcId="+$($xz[i]).val();
                        //如果不是最后一个元素，需要在后面追加一个&符
                        if(i<$xz.length-1){
                            param += "&";
                        }
                    }
                    $.ajax({
                        url : "marketing/delete",
                        data : param,
                        type : "post",
                        dataType : "json",
                        success : function (data) {
                            if(data.success){
                                //删除客户成功之后，会进行一次页面刷新，刷新出保存的用户，根据创建时间来进行排序
                                pageList(1,$("#marketingPage").bs_pagination('getOption', 'rowsPerPage'));
                            }else{
                                alert("删除市场活动失败");
                            }
                        }
                    })
                }
            }
        });

        //为查询按钮绑定事件(暂未开发)
        $("#searchBtn").click(function () {
            $("#hidden-name").val($.trim($("#search-name").val()));
            var name = $("#search-name").val();
            pageList(1,2);
        });

        //因为动态生成的元素，是不能够以普通绑定事件的形式来进行操作的
        $("#marketingBody").on("click",$("input[name=xz]"),function () {

            $("#qx").prop("checked",$("input[name=xz]").length==$("input[name=xz]:checked").length);

        });


        //进入客户管理页面，我们需要进行一次分页查询
        pageList(1,2);

        //用来处理分页请求
        function pageList(pageNo,pageSize) {

            //将全选的复选框的√干掉
            $("#qx").prop("checked",false);

            $.ajax({

                    url: "marketing/"+pageNo+"/"+pageSize,
                    type: "get",
                    dataType: "json",
                    success: function (data) {

                        var html = "";

                        $.each(data.dataList, function (i, n) {

                            html += '<tr class="active">';
                            html += '<td><input type="checkbox" name="xz" value="'+n.chcId+'"/></td>';
							html += '<td>'+n.chcCustName+'</td>';
                            html += '<td>'+n.chcTitle+'</td>';
                            html += '<td>'+n.chcLinkman+'</td>';
                            html += '<td>'+n.chcTel+'</td>';
							html += '<td>'+new Date(n.chcCreateDate).format("yyyy-MM-dd")+'</td>';
							html += '</tr>';



                        });
                        $("#marketingBody").html(html);
						//计算总页数
						var totalPages = data.total%pageSize==0?data.total/pageSize:parseInt(data.total/pageSize)+1;
						//数据处理完毕后，结合分页查询，对前端展现分页信息
						$("#marketingPage").bs_pagination({
							currentPage: pageNo, // 页码
							rowsPerPage: pageSize, // 每页显示的记录条数
							maxRowsPerPage: 20, // 每页最多显示的记录条数
							totalPages: totalPages, // 总页数
							totalRows: data.total, // 总记录条数

							visiblePageLinks: 3, // 显示几个卡片

							showGoToPage: true,
							showRowsPerPage: true,
							showRowsInfo: true,
							showRowsDefaultInfo: true,

							//该回调函数时在，点击分页组件的时候触发的
							onChangePage: function (event, data) {
								pageList(data.currentPage, data.rowsPerPage);
							}
						});

                    }
                }
            )}


		Date.prototype.format = function(fmt) {
			var o = {
				"M+" : this.getMonth() + 1, // 月份
				"d+" : this.getDate(), // 日
				"h+" : this.getHours(), // 小时
				"m+" : this.getMinutes(), // 分
				"s+" : this.getSeconds(), // 秒
				"q+" : Math.floor((this.getMonth() + 3) / 3), // 季度
				"S" : this.getMilliseconds()
				// 毫秒
			};
			if (/(y+)/.test(fmt))
				fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "")
						.substr(4 - RegExp.$1.length));
			for ( var k in o)
				if (new RegExp("(" + k + ")").test(fmt))
					fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k])
							: (("00" + o[k]).substr(("" + o[k]).length)));
			return fmt;
		}
        });
</script>
</head>
<body>
<%--根据用户名查询用户隐藏域--%>
<input type="hidden" id="hidden-name"/>
<input type="hidden" id="designate-chcId">
<%--指派客户经理窗口--%>
<div class="modal fade" id="designateManagerModal" role="dialog">
	<div class="modal-dialog" role="document" style="width: 85%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="myModalLabel2">指派执行经理</h4>
			</div>
			<div class="modal-body">
				<form id="designateManagerForm" class="form-horizontal" role="form">

					<div class="form-group">
						<label for="designate-chcCustName" class="col-sm-2 control-label">客户名称</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="designate-chcCustName" disabled>
						</div>
						<%--接手人id--%>
						<input type="hidden" id="designate-commonCreateId">
						<label for="designate-chcDueTo" class="col-sm-2 control-label">接手人<span style="font-size: 15px; color: red;">*</span></label>
						<div class="col-sm-10" style="width: 300px;">
							<select class="form-control" id="designate-chcDueTo">

							</select>
						</div>


						<label for="designate-commonCreateBy" class="col-sm-2 control-label">原创建人<span style="font-size: 15px; color: red;">*</span></label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="designate-commonCreateBy" disabled>
						</div>
					</div>
				</form>

			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary" data-dismiss="modal" id="designateBtn">指派</button>
			</div>
		</div>
	</div>
</div>

<!-- 创建销售机会的模态窗口 -->
<div class="modal fade" id="createSalChanceModal" role="dialog">
	<div class="modal-dialog" role="document" style="width: 85%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="myModalLabel1">创建销售机会</h4>
			</div>
			<div class="modal-body">
				<form id="marketingCreateForm" class="form-horizontal" role="form">
					<input type="hidden" id="create-chcId"/>
					<div class="form-group">
						<label for="create-chcSource" class="col-sm-2 control-label">机会来源<span style="font-size: 15px; color: red;">*</span></label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="create-chcSource">
						</div>

						<label for="create-chcCustName" class="col-sm-2 control-label">客户名称<span style="font-size: 15px; color: red;">*</span></label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="create-chcCustName">
						</div>
					</div>

					<div class="form-group">

						<label for="create-chcTitle" class="col-sm-2 control-label">机会概要</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="create-chcTitle">
						</div>

						<label for="create-chcRate" class="col-sm-2 control-label">成功率</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="create-chcRate">
						</div>

					</div>

					<div class="form-group">

						<label for="create-chcLinkman" class="col-sm-2 control-label">联系人</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="create-chcLinkman">
						</div>

						<label for="create-chcTel" class="col-sm-2 control-label">联系电话</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="create-chcTel">
						</div>

					</div>

					<div class="form-group">

						<label for="create-chcDesc" class="col-sm-2 control-label">机会描述</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="create-chcDesc">
						</div>

						<input type="hidden" id="create-chcCreateId"><%--创建机会编号--%>
						<label for="create-chcCreateBy" class="col-sm-2 control-label">机会创建人</label>
						<div class="col-sm-10" style="width: 300px;">
							<select class="form-control" id="create-chcCreateBy">

							</select>
						</div>

					</div>

					<shiro:hasPermission name="sell:appoint">
						<div class="form-group">

							<input type="hidden" id="create-chcDueId"><%--机会处理编号--%>

							<label for="create-chcDueTo" class="col-sm-2 control-label">处理人（经理/主管）</label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="create-chcDueTo">

								</select>
							</div>
						</div>
					</shiro:hasPermission>
				</form>

			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary" data-dismiss="modal" id="createBtn">创建</button>
			</div>
		</div>
	</div>
</div>

<!-- 修改销售机会的模态窗口 -->
<div class="modal fade" id="editSalChanceModal" role="dialog">
	<div class="modal-dialog" role="document" style="width: 85%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="myModalLabel">修改销售机会</h4>
			</div>
			<div class="modal-body">
				<form id="marketingEditForm" class="form-horizontal" role="form">
					<input type="hidden" id="edit-chcId"/>
					<div class="form-group">
						<label for="edit-chcSource" class="col-sm-2 control-label">机会来源<span style="font-size: 15px; color: red;">*</span></label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-chcSource">
						</div>

						<label for="edit-chcCustName" class="col-sm-2 control-label">客户名称<span style="font-size: 15px; color: red;">*</span></label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-chcCustName">
						</div>
					</div>

					<div class="form-group">

						<label for="edit-chcTitle" class="col-sm-2 control-label">机会概要</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-chcTitle" disabled>
						</div>

						<label for="edit-chcRate" class="col-sm-2 control-label">成功率</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-chcRate">
						</div>

					</div>

					<div class="form-group">

						<label for="edit-chcLinkman" class="col-sm-2 control-label">联系人</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-chcLinkman">
						</div>

						<label for="edit-chcTel" class="col-sm-2 control-label">联系电话</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-chcTel">
						</div>

					</div>

					<div class="form-group">

						<label for="edit-chcDesc" class="col-sm-2 control-label">机会描述</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-chcDesc">
						</div>

						<input type="hidden" id="edit-chcCreateId"><%--创建机会编号--%>

						<label for="edit-chcCreateBy" class="col-sm-2 control-label">机会创建人</label>
						<div class="col-sm-10" style="width: 300px;">
							<select class="form-control" id="edit-chcCreateBy">

							</select>
						</div>

						<label for="edit-commonCreateBy" class="col-sm-2 control-label">原创建人<span style="font-size: 15px; color: red;">*</span></label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-commonCreateBy" disabled>
						</div>

						<label for="edit-chcCreateDate" class="col-sm-2 control-label">创建时间</label>
						<input type="hidden" id="edit-commonCreateDate">
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control"  id="edit-chcCreateDate" disabled>
						</div>

					</div>

					<div class="form-group">

						<input type="hidden" id="edit-chcDueId"><%--机会处理编号--%>

						<label for="edit-chcDueTo" class="col-sm-2 control-label">处理人</label>
						<div class="col-sm-10" style="width: 300px;">
							<select class="form-control" id="edit-chcDueTo">

							</select>
						</div>

						<label for="edit-chcStatus" class="col-sm-2 control-label">处理状态</label>
						<div class="col-sm-10" style="width: 300px;">
							<input type="text" class="form-control" id="edit-chcStatus">
						</div>

					</div>
				</form>

			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary" data-dismiss="modal" id="updateBtn">更新</button>
			</div>
		</div>
	</div>
</div>


<div>
	<div style="position: relative; left: 10px; top: -10px;">
		<div class="page-header">
			<h3>销售机会列表</h3>
		</div>
	</div>
</div>

<div style="position: relative; top: -20px; left: 0px; width: 100%; height: 100%;">

	<div style="width: 100%; position: absolute;top: 5px; left: 10px;">

		<div class="btn-toolbar" role="toolbar" style="height: 80px;">
			<form class="form-inline" role="form" style="position: relative;top: 8%; left: 5px;">

				<div class="form-group">
					<div class="input-group">
						<div class="input-group-addon">客户名称</div>
						<input class="form-control" type="text" id="search-name">
					</div>
				</div>

				<button type="submit" class="btn btn-default" id="searchBtn">查询</button>

			</form>
		</div>
		<div class="btn-toolbar" role="toolbar" style="background-color: #F7F7F7; height: 50px; position: relative;top: 5px;">
			<div class="btn-group" style="position: relative; top: 18%;">
				<button type="button" class="btn btn-default" data-toggle="modal" data-target="#createSalChanceModal" id="createOpenBtn" ><span class="glyphicon glyphicon-plus"></span> 创建</button>
				<button type="button" class="btn btn-default" data-toggle="modal" data-target="#editCustomerModal" id="editBtn"><span class="glyphicon glyphicon-pencil"></span> 修改</button>
				<shiro:hasPermission name="sell:appoint">
				<button type="button" class="btn btn-default" data-toggle="modal" data-target="#designateManagerModal" id="designateOpenBtn" ><span class="glyphicon glyphicon-hand-left"></span> 指派</button>
				</shiro:hasPermission>
				<button type="button" class="btn btn-danger"  id="deleteBtn"><span class="glyphicon glyphicon-remove"></span> 删除</button>
			</div>
		</div>

		<div style="position: relative;top: 10px;">
			<table class="table table-hover">
				<thead>
				<tr style="color: #B3B3B3;">
					<td><input type="checkbox" id="qx" /></td>
					<td>客户名称</td>
					<td>概要</td>
					<td>联系人</td>
					<td>联系人电话</td>
					<td>创建时间</td>
				</tr>
				</thead>
				<tbody id="marketingBody">
				</tbody>
			</table>
		</div>

		<div style="height: 50px; position: relative;top: 30px;">
			<div id="marketingPage"></div>
		</div>

	</div>

</div>
</body>
</html>